package com.qianfeng.smartdevice.pojo;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;

@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(description = "用户数据对象")
public class User implements  CheckEmptyInterface{
    @ApiModelProperty(value = "主键ID",example = "1")
    private Long id;
    @ApiModelProperty(value = "用户名",required = true,example = "admin")
    private String username;
    @ApiModelProperty(value = "密码",required = true,example = "123456")
    private String password;

    @ApiModelProperty(value = "上次登录时间",hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date lastlogin;

    @ApiModelProperty(value = "当前登录时间",hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date currentlogin;

    @ApiModelProperty(value = "注册时间",hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date regdate;

    @ApiModelProperty(value = "用户类型",required = true,example = "1")
    private String type;

    @ApiModelProperty(value = "状态",required = true,example = "1")
    private String status;

    @ApiModelProperty(value = "其他数据1")
    private String data1;
    @ApiModelProperty(value = "其他数据1")
    private String data2;

    @ApiModelProperty(value = "用户所属角色")
    private List<Role> roleList;

    public List<Role> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<Role> roleList) {
        this.roleList = roleList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getRegdate() {
        return regdate;
    }

    public void setRegdate(Date regdate) {
        this.regdate = regdate;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }


    public Date getLastlogin() {
        return lastlogin;
    }

    public void setLastlogin(Date lastlogin) {
        this.lastlogin = lastlogin;
    }

    public Date getCurrentlogin() {
        return currentlogin;
    }

    public void setCurrentlogin(Date currentlogin) {
        this.currentlogin = currentlogin;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    public String getData1() {
        return data1;
    }

    public void setData1(String data1) {
        this.data1 = data1;
    }


    public String getData2() {
        return data2;
    }

    public void setData2(String data2) {
        this.data2 = data2;
    }

    @Override
    public boolean isEmpty() {
        return username == null && password == null && type == null && status == null;
    }
}
